import { get, post, del, put } from "@/utils/request";
import { ListResult, AddParams } from "./type";

// 部门列表
export const getDepartmentList = () => {
  return get<null, ListResult>('/api/department/list');
}

// 部门添加
export const addDepartment = (data: AddParams) => {
  return post<AddParams, string>('/api/department/add', data)
}

// 部门删除
export const delDepartment = (id: number) => {
  return del<number, string>(`/api/department/delete/` + id)
}

// 部门修改
export const updateDepartment = (data: AddParams) => {
  return put<AddParams, string>('/api/department/update', data)
}
